package com.codingapi.demo.serverorder.demo;

import com.alibaba.fastjson.JSON;
import com.codingapi.demo.serverorder.feign.UserClient;
import com.codingapi.netflix.framework.exception.ServerFeignException;
import com.codingapi.swagger.entity.User;
import com.codingapi.swagger.response.JsonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author modificial
 * @date 2018/7/27
 * @company codingApi
 * @description
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户测试")
public class UserTest {
    @Autowired
    private UserClient userClient;
    @GetMapping("/test")
    public String  testListUser() throws ServerFeignException {
       JsonResult result = userClient.listUser();

       return JSON.toJSONString(result);
    }
}
